import java.awt.event.MouseEvent;
import java.util.Vector;

import javax.swing.*;

public class ListUserOnlineGUI extends MyEvent{
	private JFrame jListUserForm;
	private JList<String> jListOnline;
	private Vector<String> vtUser = new Vector<>();;
	
	public ListUserOnlineGUI(String username){
		jListUserForm = new JFrame("List user online");
		vtUser.add(username);
		
		jListOnline = new JList<>(vtUser);
		jListOnline.addMouseListener(this);
		
		jListUserForm.add(jListOnline);
	}
	public void CreateGUI(){
		jListUserForm.pack();
		jListUserForm.setVisible(true);
	}
	
	public static void main(String[] args) {
		ListUserOnlineGUI gui = new ListUserOnlineGUI("test");
		gui.CreateGUI();
	}
	@Override
	public void mouseClicked(MouseEvent e) {
		if(e.getSource() == jListOnline){
			ChatForm chatForm = new ChatForm();
			chatForm.CreateGUI();
		}
	}
}
